home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / docs / misc / ConcNews.lha / news / general.programming / comp.sys.amiga.programmer_22987_000002.msg < prev    next >
Encoding:
Internet Message Format  |  1994-11-27  |  1.8 KB

  1. Path: etek.chalmers.se!chalmers.se!sunic!mcsun!uunet!ukma!gatech!concert!sas!mozart.unx.sas.com!jamie
  2. From: jamie@cdevil.unx.sas.com (James Cooper)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: SAS6.1 users: please read
  5. Message-ID: <Byr0Gs.1qn@unx.sas.com>
  6. Date: 4 Dec 92 18:53:14 GMT
  7. References: <92337.012542MLO@SLACVM.SLAC.STANFORD.EDU> <ByMz9y.J0H@fc.hp.com>
  8. Sender: news@unx.sas.com (Noter of Newsworthy Events)
  9. Organization: SAS Institute Inc.
  10. Lines: 32
  11. Originator: jamie@cdevil.unx.sas.com
  12. Nntp-Posting-Host: cdevil.unx.sas.com
  13.  
  14.  
  15. In article <ByMz9y.J0H@fc.hp.com>, koren@fc.hp.com (Steve Koren) writes:
  16. >LORETI, Maurizio (MLO@SLACVM.SLAC.STANFORD.EDU) wrote:
  17. >> Is this a real error? strlen returns a size_t argument
  18. >> according with ANSI, and size_t (defined in <stddef.h>) is
  19. >
  20. >Maybe you're right; maybe its supposed to because size_t is unsigned int
  21. >even though num is signed.
  22. >
  23. >However, at the very least it is something to be aware of, because when
  24. >I compile this under 5.10b it does just the opposite thing with the same
  25. >code :-)
  26. >
  27. >I can believe the program is doing the correct thing by ANSI standards.
  28. >But personally, I'd expect the result of doing arithmetic on a signed
  29. >and unsigned int to result in a signed number.
  30.  
  31. Maurizio is correct.  Your code is operating according to the ANSI
  32. standard rules for handling mathematics on different types (unsigned vs
  33. signed).  Therefore, this cannot be "fixed"...
  34.  
  35. It is something worth noting, though.  Perhaps we can add it to Appendix
  36. 5, "Converting from Version 5 to Version 6" in the next set of manuals
  37. (and update pages, when we do 'em).
  38.  
  39. -- 
  40. ---------------
  41. Jim Cooper
  42. (jamie@unx.sas.com)                             bix: jcooper
  43.  
  44. Any opinions expressed herein are mine (Mine, all mine!  Ha, ha, ha!),
  45. and not necessarily those of my employer.
  46.